<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">

    <body>

        <ui:composition template="./newTemplate.xhtml">

            <ui:define name="content">
                <h:form>
                    <center>
                        <p:panelGrid columns="2" > 
                            <h:outputText id="lblTexto" value="Seleccione un Solicitante: " />
                            <p:selectOneMenu id="txtCodUsuario" value="#{hdTicketsController.codUsuario}" required="true">
                                <f:selectItems value="#{hdUsuariosController.itemsAvailableSelectOne}" />
                            </p:selectOneMenu>
                            <f:facet name="footer"> 
                                <p:commandButton id="btnaccionar" value="Procesar"  action="#{hdTicketsController.ejecutaAccion}" ajax="false"/>
                            </f:facet>
                        </p:panelGrid>   
                    </center>
                    <br />

                    <p:dataTable value="#{hdTicketsController.ticketsSolicitante}" id="tbltickets" var="tickets" paginator="true" rows="10">
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="Codigo" />
                            </f:facet>
                            <h:outputText id="codTicket1" value="#{tickets.codTicket}" />
                        </p:column>
                        <p:column filterBy="#{tickets.descTicket}" filterMatchMode="contains">
                            <f:facet name="header">
                                <h:outputText value="Descripcion"/>

                            </f:facet>
                            <h:outputText id="descTicket" value="#{tickets.descTicket}" escape="false"/>

                        </p:column>
                        <p:column sortBy="#{tickets.fecResolucion}">
                            <f:facet name="header">
                                <h:outputText value="Fec Resolucion" />
                            </f:facet>
                            <h:outputText id="fecResolucion" value="#{tickets.fecResolucion}" >
                                <f:convertDateTime pattern="MM/dd/yyyy" />
                            </h:outputText>  

                        </p:column>
                        <p:column sortBy="#{tickets.codEstado.descEstado}">
                            <f:facet name="header">
                                <h:outputText value="Estado" />

                            </f:facet>
                            <h:outputText id="codEstado" value="#{tickets.codEstado.descEstado}" />
                        </p:column>

                    </p:dataTable>  
                </h:form>
            </ui:define>

            <ui:define name="bottom">
                bottom
            </ui:define>

        </ui:composition>

    </body>
</html>
